/**************************************************************************
 *
 * Copyright 2014 MaeckySoft Ltd., Bludenz, Austria.
 * All Rights Reserved.
 *
 **************************************************************************/

#ifdef __unix__

#ifndef MWINDOW_H
#define MWINDOW_H

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>

#include <MOpenGL.h>
#include <M3DBase.h>

class MWindow : M3DBase
{
    public:
        MWindow(int iDebug);
        bool createWindow(int x, int y,char *sDpyName);
        void make_x_window(
              Display *DPYMain,
              EGLDisplay EGLDMain,
              const char *sName,
              int x, int y,
              int iWidth, int iHeight,
              Window *WinRet,
              EGLContext *EGLCRet,
              EGLSurface *EGLSRet);
        void event_loop(
              Display *DPYMain,
              Window WINMain,
              EGLDisplay EGLDMain,
              EGLSurface EGLSMain);
	    void printMethodInfo(std::string method);
        ~MWindow();
    protected:
    private:
        MOpenGL *m_MOGLOgl;
        Display *DPYMain;
        Window WINMain;
        EGLSurface EGLSMain;
        EGLContext EGLCMain;
        EGLDisplay EGLDMain;

};
#endif

#endif // MWINDOW_H
